package com.mvc.business.model;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.mvc.ProjectUtils;
import com.mvc.base.model.BaseCompany;
import com.mvc.base.model.Customer;
import com.mvc.base.model.Picture;

@Entity(name = "B_QUOTATION")
public class Quotation extends BaseCompany {

	@NotNull
	private Integer	                 customerId;
	@NotNull
	private Integer	                 salesId;

	@NotNull
	private Integer	                 status;
	@NotNull
	private Integer	                 currency;

	@NotNull
	private Date	                 generateDate;
	@NotNull
	private Date	                 expiredDate;
	@NotNull
	@Length(max = 64)
	private String	                 title;
	@Length(max = 2048)
	private String	                 specification;
	@Length(max = 512)
	private String	                 packing;
	@Length(max = 512)
	private String	                 origination;
	@Length(max = 256)
	private String	                 note;
	@Length(max = 128)
	private String	                 payment;

	private Integer	                 appovalUserId;

	private Double	                 total;
	private Double	                 quantity;

	private Date	                 deliveryDate;

	@Transient
	private Customer	             customer;

	@Transient
	private List<QuotationItem>	     quotationItems;

	@Transient
	private List<QuotationExtraItem>	quotationExtraItems;

	@Transient
	private List<Picture>	         pictures;

	public Integer getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Integer customerId) {
		this.customerId = customerId;
	}

	public Integer getSalesId() {
		return salesId;
	}

	public void setSalesId(Integer salesId) {
		this.salesId = salesId;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Date getGenerateDate() {
		return generateDate;
	}

	public void setGenerateDate(Date generateDate) {
		this.generateDate = generateDate;
	}

	public Date getExpiredDate() {
		return expiredDate;
	}

	public void setExpiredDate(Date expiredDate) {
		this.expiredDate = expiredDate;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSpecification() {
		return specification;
	}

	public void setSpecification(String specification) {
		this.specification = specification;
	}

	public String getPacking() {
		return packing;
	}

	public void setPacking(String packing) {
		this.packing = packing;
	}

	public String getOrigination() {
		return origination;
	}

	public void setOrigination(String origination) {
		this.origination = origination;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public Integer getCurrency() {
		return currency;
	}

	public void setCurrency(Integer currency) {
		this.currency = currency;
	}

	public List<QuotationItem> getQuotationItems() {
		return quotationItems;
	}

	public void setQuotationItems(List<QuotationItem> quotationItems) {
		this.quotationItems = quotationItems;
	}

	public List<QuotationExtraItem> getQuotationExtraItems() {
		return quotationExtraItems;
	}

	public void setQuotationExtraItems(List<QuotationExtraItem> quotationExtraItems) {
		this.quotationExtraItems = quotationExtraItems;
	}

	public List<Picture> getPictures() {
		return pictures;
	}

	public void setPictures(List<Picture> pictures) {
		this.pictures = pictures;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public String getQuotationNo() {
		return ProjectUtils.getQuotationNo(getObjectId());
	}

	public Integer getAppovalUserId() {
		return appovalUserId;
	}

	public void setAppovalUserId(Integer appovalUserId) {
		this.appovalUserId = appovalUserId;
	}

	public String getPayment() {
		return payment;
	}

	public void setPayment(String payment) {
		this.payment = payment;
	}

	public Double getTotal() {
		return total;
	}

	public void setTotal(Double total) {
		this.total = total;
	}

	public Double getQuantity() {
		return quantity;
	}

	public void setQuantity(Double quantity) {
		this.quantity = quantity;
	}

	public Date getDeliveryDate() {
		return deliveryDate;
	}

	public void setDeliveryDate(Date deliveryDate) {
		this.deliveryDate = deliveryDate;
	}

}
